import {request, uploadFile} from '@/util/request.js'

//登录
export const login = data => request({url: 'szcg/app/login', method: 'POST', data: data});

//退出登录
export const logout = data => request({url: 'szcg/app/logout', method: 'POST', data: data});

//统计处置人员待办（待处置）案件
export const countCzryTodoEvent = data => request({url: 'szcg/app/event/countCzryTodoEvent', data: data});

//统计巡检员待办（待编辑，待核实，待核查）案件
export const countXjyTodoEvent = data => request({url: 'szcg/app/event/countXjyTodoEvent', data: data});

//查询案件列表
export const queryEventList = data => request({url: 'szcg/app/event/list', data: data, method: 'POST'});

export const queryEditList = data => request({url: 'szcg/app/event/editList', data: data, method: 'POST'});

//查询巡检员处置人员历史案件
export const queryHistoryEventList = data => request({url: 'szcg/app/event/historyList', data: data, method: 'POST'});

//查询案件详情
export const queryEventDetail = data => request({url: `szcg/app/event/detail/${data.eventId}`});

//案件处置/回退
export const eventDeal = data => request({url: `szcg/app/event/deal`, data: data, method: 'POST'});

//统计未读数量
export const queryCountUnRead = data => request({ url: `szcg/common/push/countUnRead`, data: data,  method: 'GET' });

//根据消息id查询消息
export const queryMessage = data => request({url: `szcg/common/push/message/${data.messageId}`, method: 'GET'});

//查询消息列表
export const queryMessageList = data => request({url: `szcg/common/push/messageList`, data: data, method: 'POST'});

//修改消息状态为已读
export const modifyUnReadStatus = data => request({url: `szcg/common/push/read`, data: data, method: 'POST'});

//获取任务部署列表
export const querySzbmJsdBusinessList = data => request({url: 'app/jsd/getSzbmJsdBusinessList', data: data, method: 'GET'});

//获取历史事中任务详情
export const querySzbmJsdBusinessMiddle = data => request({url: 'app/jsd/getSzbmJsdBusinessMiddleById', data: data, method: 'GET'});

//获取历史事前任务详情
export const querySzbmJsdBusiness = data => request({url: 'app/jsd/getSzbmJsdBusinessById', data: data, method: 'GET'});

//获取积水点列表
export const queryMiddleJsdList = data => request({url: 'app/jsd/getMiddleJsdList', data: data, method: 'GET'});

//获取积水点列表
export const queryJsdList = data => request({url: 'app/jsd/getJsdList', data: data, method: 'GET'});

//获取历史事前详情雨水篦子详情
export const querySzbmJsdHistory = data => request({url: 'app/jsd/getSzbmJsdHistoryByBusinessId', data: data, method: 'GET'});

//通过任务部署id和积水点id获取事中任务上报
export const queryTaskDetail = data => request({ url: 'app/jsd/getSzbmJsdBusinessMiddleReportByBusinessIdAndjsdId', data: data});

//查询案件大类
export const queryEventTypelv1 = data => request({ url: `szcg/common/dict/eventTypelv1/${data.type}`});

//查询案件小类
export const queryEventTypelv2 = data => request({ url: `szcg/common/dict/eventTypelv2/${data.parentId}`});

//查询立案条件
export const queryEventTypelv3 = data => request({ url: `szcg/common/dict/eventTypelv3/${data.parentId}`});

export const queryEventTypelv = data => request({ url: `szcg/common/dict/${data.type}/${data.val}`});

//案件类型模糊搜索
export const queryEventTypeByLv2Name = data => request({ url: `szcg/common/dict/eventTypeByLv2Name`, data});

//查询案件类型
export const queryEventType = data => request({ url: `szcg/common/dict/eventType`});

//查询案件状态
export const queryEventStatus = data => request({ url: `szcg/common/dict/eventStatus`});

//查询案件处理状态
export const queryEventDealStatus = data => request({ url: `szcg/common/dict/eventDealStatus/${data.parentCode}` });

//通过任务id和积水点id获取是否事前上报过
export const queryCheckIsReport = data => request({ url: `app/jsd/getCheckIsReportByBusinessIdAndjsdId`, data: data });

//添加事前任务
export const insertSzbmJsdBusinessBefore = data => request({url: `app/jsd/insertSzbmJsdBusinessBefore`, data: data, method: 'POST'});

//添加事前任务--视频
export const insertSzbmJsdBusinessBeforeVideo = (data, tempFilePath)=> uploadFile({url: `app/jsd/insertSzbmJsdBusinessBeforeVideo`, data: data, tempFilePath: tempFilePath});

//添加事中任务上报
export const insertSzbmJsdBusinessMiddleReport = data => request({url: `app/jsd/insertSzbmJsdBusinessMiddleReport`, data: data, method: 'POST'});

//添加事前任务--视频
export const insertSzbmJsdBusinessMiddleReportVideo = (data, tempFilePath)=> uploadFile({url: `app/jsd/insertSzbmJsdBusinessMiddleReportVideo`, data: data, tempFilePath: tempFilePath});

//查询apk 版本
export const getAppVersion = () => request({url: `app/toilet/getAppVersion?type=GXHandle`, urlType: 'debug', method: 'POST', hideLoading: true})

///高德地图区划边界
export const getRegions = data => request({url: `szcg/common/dict/getAdministrative_regionBoundary`, data: data});

//查询点位周边案件
export const queryNearbyEvent = data => request({url: `szcg/app/event/nearbyEvent`, data: data, method: 'POST'});

//查询巡检员网格
export const queryCheckRegion = data => request({url: `szcg/app/event/xjyRegion/${data.userId}`});

//根据立案条件id查询三方处置机构网格
export const queryOrgRegion = data => request({url: `szcg/common/dict/orgRegionByEventTypelv3/${data.eventTypelv3Id}`});

//上报案件
export const createEevet = data => request({url: `szcg/app/event/add`, data, method: 'POST'});

//更新案件
export const updateEvent = data => request({url: `szcg/app/event/update`, data, method: 'POST'});

//积水点
export const countWater = data => request({url: `api/pad/council/countWater`, data, method: 'POST', urlType: 'debug'});

//打卡
export const signIn = data => request({url: `szcg/app/signIn/clock`, data, method: 'POST'});

//帮助列表
export const getHelp = data => request({url: `szcg/app/help/list`, data});

//用户轨迹
export const getUserTrajectory = data => request({url: `szcg/app/event/userTrajectory`, data});

//追踪反馈
export const traceEvent = data => request({url: `szcg/app/event/urge`, data, method: 'POST'});

//获取时间段字典列表
export const queryWarningParams = data => request({url: `api/fullscreen/warningParams`, data, method: 'POST', urlType: 'debug'});

//获取巡检员负责网格边界
export const getWarningInfoByUserId = data => request({url: `api/fullscreen/getWarningInfoByUserId`, data, method: 'POST', urlType: 'debug'});

//获取公厕列表
export const getInspectionToiletList = data => request({url: `api/toiletCommon/inspectionToilet/getInspectionToiletList`, data, urlType: 'debug'});

export const selectIsInspection = data => request({url: `api/toiletCommon/inspectionToilet/selectIsInspection`, data, urlType: 'debug'});

export const getDicList = () => request({url: `api/toiletCommon/inspectionToilet/getDicList`, urlType: 'debug'});

export const getDicList1 = (data) => request({url: `api/app/toiletInspection/noStandardDict`, data, urlType: 'debug'});

export const insertDataToiletInspection =(data) => request({url: `api/toiletCommon/inspectionToilet/insertDataToiletInspection`, data, method: 'POST', urlType: 'debug'});

export const insertNoInspection = (data) => request({url: `api/app/toiletInspection/insertNoInspection`, data, method: 'POST', urlType: 'debug'});

export const insertDataToiletInspectionLog = (data) => request({url: `api/toiletCommon/inspectionToilet/insertDataToiletInspectionLog`, data, method: 'POST', urlType: 'debug'});


//加水点
//消防栓点位列表
export const getSXCBList = (data) => request({url: `api/app/sxcb/getSXCBList`, data, method: 'POST', urlType: 'debug'});

//查周
export const selectWeekYear = (data) => request({url: `api/app/sxcb/selectWeekYear`, data, urlType: 'debug'});

//加水点位详情
export const getSXCBInfoById = (data) => request({url: `api/app/sxcb/getSXCBInfoById`, data, method: 'POST', urlType: 'debug'});

//加水点检查
export const checkSXCB = (data) => request({url: `api/app/sxcb/addSXCB_check`, data, method: 'POST', urlType: 'debug'});

//获取token
export const getAgoraRTMToken = (data) => request({url: `business/app/shengwangtoken/getShengWangRTCToken`, data, method: 'GET'});

//上传用户Gps
export const addUserGps = (data) => request({url: `szcg/app/event/addUserGps`, data, method: 'POST', hideLoading: true});

//签到查询
export const queryClockList = (data) => request({url: `szcg/app/signIn/clockList`, data, method: 'POST'});

//查询巡检员
export const getXJYList = (data) => request({url: `szcg/app/event/getXJYList`, data});

//巡检员点位
export const getUserGps = (data) => request({url: `szcg/app/event/selectUserPath/${data.time}`});

//根据坐标查询巡检员
export const queryxjysBylnglat = (data) => request({url: `szcg/app/event/xjysBylnglat`, data});

//根据坐标查询班次
export const queryShiftByLngLat = (data) => request({url: `szcg/app/event/selectXjyWeekInfoByLngLat`, data});

//查询附件的部件
export const queryParts = (data) => request({url: `szcg/common/dict/parts`, data});

//app端视频通话推送消息给PC端
export const sendWebsocket = (data) => request({url: `business/app/shengwangtoken/sendWebsocket`,data, method: 'POST', contentType: 'json'});

export const sendWebsocketComeIn = (data) => request({url: `business/app/shengwangtoken/sendWebsocketComeIn`,data, method: 'POST', contentType: 'json'});